<?php namespace Admin\Controller; 

use Hdphp\Controller\Controller;

//测试控制器
class LoginController extends Controller{
	private $adminModel;
	public function __init(){
		$this->adminModel = new \Common\Model\Admin;
	}
    //登陆
    public function index(){
    	if(IS_POST){
    		if(!$this->adminModel->login()) View::error($this->adminModel->getError());
			View::success('登陆成功，返回首页',U('Admin/Index/index'));
    	}
       	View::make();
    }
//	验证码
	public function code(){
		Code::num(4)->fontSize(14)->width(104)->height(44)->make();
	}
//	退出
	public function quit(){
		session_unset();
		session_destroy();
		go(U('Index/index'));
	}
}
